package cn.hahah.module.blog.dal.mysql.userdialoguepersonal;

import java.util.*;

import cn.hahah.framework.common.pojo.PageResult;
import cn.hahah.framework.mybatis.core.query.LambdaQueryWrapperX;
import cn.hahah.framework.mybatis.core.mapper.BaseMapperX;
import cn.hahah.module.blog.dal.dataobject.userdialoguepersonal.UserDialoguePersonalDO;
import org.apache.ibatis.annotations.Mapper;
import cn.hahah.module.blog.controller.admin.userdialoguepersonal.vo.*;

/**
 * 用户对话个人 Mapper
 *
 * @author 芋道源码
 */
@Mapper
public interface UserDialoguePersonalMapper extends BaseMapperX<UserDialoguePersonalDO> {

    default PageResult<UserDialoguePersonalDO> selectPage(UserDialoguePersonalPageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<UserDialoguePersonalDO>()
                .eqIfPresent(UserDialoguePersonalDO::getUserId, reqVO.getUserId())
                .eqIfPresent(UserDialoguePersonalDO::getGroupId, reqVO.getGroupId())
                .betweenIfPresent(UserDialoguePersonalDO::getCreateTime, reqVO.getCreateTime())
                .orderByDesc(UserDialoguePersonalDO::getId));
    }

}